<?php $this->load->view('Pre/common/header.html');?>
<link rel="stylesheet" type="text/css" href="<?php echo base_url('common/home')?>/css/style.css" />
<script type="text/javascript" src="<?php echo base_url()?>common/layer/layer.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/home/js/jquery.form.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/home/js/jquery.validate.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/home/js/additional-methods.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/home/js/validate.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/home/js/validateForm.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/js/jquery.Msg.js"></script>
<script type="text/javascript">
    function Success(data) {
        if (data.Statu == 'ok') {
            _login_success();
        } else {
            _login_fail();
        }
    }

    function _login_success() {

        var lindex = layer.open({
            type: 2,
            title: false,
            maxmin: false,
            shadeClose: false, //开启点击遮罩关闭层
            area: ['424px', '419px'],
            offset: ['100px', ''],
            closeBtn: 0,
            content: '<?php echo site_url('login/login_success')?>' + '?backurl=<?php echo $backurl?>'
        });
        var out = '<a href="javascript:signout()" style="float:right;color:#717171;font-size:14px;margin-right:3px;">退出</a>';
        $(".welcome .welcome1200").append(out);
        get_cart_after_login('<?php echo site_url()?>')
    }

    function _login_fail() {
        var lindex = layer.open({
            type: 2,
            title: false,
            maxmin: false,
            shadeClose: false, //开启点击遮罩关闭层
            area: ['424px', '419px'],
            offset: ['100px', ''],
            closeBtn: 0,
            content: '<?php echo site_url('login/login_fail')?>'
        });
        setTimeout(function () {
            layer.close(lindex);
        }, 2000);
    }

    $(function () {
        $.validate_dologin('ajax_form');
    })


     function register() {
        layer.open({
            type: 2,
            title: false,
            maxmin: false,
            shadeClose: false, //开启点击遮罩关闭层
            area: ['424px', '606px'],
            offset: ['100px', ''],
            closeBtn: 0,
            content: '<?php echo site_url('login/register')?>'
        });
    }
</script>


<div class="divLogin">
    <!--登录 begin-->
    <div class="hLogin1">
        <h1>会员登录</h1>
        <form id="ajax_form" method="post" action="<?php echo site_url('login/do_login')?>" style="margin-bottom:0;">
            <input id="account" name="account" class="hLoginName1" type="text" placeholder="请输入用户名或邮箱" />
            <input id="pass" name="pass" class="hLoginPwd1" type="password" placeholder="请输密码" />
            <div class="hGoReg1">还没有注册？ <span onclick="register()">立即注册</span></div>
            <input class="hLoginBtns1" type="submit" value="登    录" />
        </form>
    </div>
    <!--登录 end-->
</div>

<?php $this->load->view('Pre/common/footer.html');?>